from pynput.keyboard import Key, Controller
import time

# 准备演奏
# 控制键盘
keyboard = Controller()
# 切换到jQuery键盘钢琴网页
keyboard.press(Key.alt)
time.sleep(1)
keyboard.press(Key.tab)
keyboard.release(Key.tab)
keyboard.release(Key.alt)
time.sleep(2)
for n in "LONOL LQPPO LONOM MMOTS PPRRQQ QQNPOONO ONOR LSRQP PPRRQQ QQVUTUV VPOT TTSSS LSRQ-QRQ QRQRQPO OQST TTSPPRQ OQST TTSPPRQRQPO PQM MOO N O":
    if n != " ":
        keyboard.press(n.lower())
        time.sleep(0.48)
        keyboard.release(n.lower())
    elif n == '-':
        time.sleep(0.8)
    else:
        time.sleep(1.2)
